<template>
  <div class="list_ad">
    <div class="ad" v-for="(o, i) in list" :key="i">
      <div v-if="o[vm.location] === location">
        <div v-if="o[vm.img]">
          <img class="w-100" :src="$fullUrl(o[vm.img])" alt="" />
        </div>
        <div v-else v-html="o[vm.content]"></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      default: function () {
        return [];
      },
    },
    location: {
      type: String,
      default: "顶部广告",
    },
    vm: {
      type: Object,
      default: function () {
        return {
          location: "location",
          content: "content",
          img: "img",
        };
      },
    },
  },
};
</script>